home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / internet / zannetb1.zip / Zanserv.h < prev    next >
C/C++ Source or Header  |  1996-12-10  |  17KB  |  713 lines

  1.  
  2. #include <time.h>
  3. #include <sys/stat.h>
  4.  
  5. /* Note:
  6. *
  7. * Structure alignment must be 4 bytes
  8. *
  9. */
  10.  
  11.  
  12. #ifndef S_IRWXU
  13. #define S_IRWXU 0x01C0
  14. #endif
  15. #ifndef    S_IRUSR
  16. #define    S_IRUSR    0x0100
  17. #endif
  18. #ifndef    S_IWUSR
  19. #define    S_IWUSR    0x0080
  20. #endif
  21. #ifndef    S_IXUSR
  22. #define    S_IXUSR    0x0040
  23. #endif
  24.  
  25. #ifndef S_IRWXG
  26. #define S_IRWXG 0x0038
  27. #endif
  28. #ifndef    S_IRGRP
  29. #define    S_IRGRP    0x0020
  30. #endif
  31. #ifndef    S_IWGRP
  32. #define    S_IWGRP    0x0010
  33. #endif
  34. #ifndef    S_IXGRP
  35. #define    S_IXGRP    0x0008
  36. #endif
  37.  
  38. #ifndef S_IRWXO
  39. #define S_IRWXO 0x0007
  40. #endif
  41. #ifndef    S_IROTH
  42. #define    S_IROTH    0x0004
  43. #endif
  44. #ifndef    S_IWOTH
  45. #define    S_IWOTH    0x0002
  46. #endif
  47. #ifndef    S_IXOTH
  48. #define    S_IXOTH    0x0001
  49. #endif
  50.  
  51. /* typedefs for BSD unsigned things */
  52.  
  53. /**********
  54. #ifndef u_char
  55. typedef unsigned char   u_char;
  56. #endif
  57. #ifndef u_short
  58. typedef unsigned short  u_short;
  59. #endif
  60. #ifndef u_int
  61. typedef unsigned int    u_int;
  62. #endif
  63. #ifndef u_long
  64. typedef unsigned long   u_long;
  65. #endif
  66. ***********/
  67.  
  68. /* and yet more unsigned typedef styles */
  69.  
  70. #ifndef    USHORT
  71. #define    USHORT    unsigned short
  72. #endif
  73. #ifndef    ULONG
  74. #define    ULONG    unsigned long
  75. #endif
  76.  
  77. #define    TRUE    1
  78. #define FALSE    0
  79.  
  80. #define    ZANNET_CONNECT_STRING    "CONNECT"
  81. #define    ZANNET_MAX_READDIRS        1000
  82.  
  83. #define    ZANNET_VERSION_MAJOR    1
  84. #define    ZANNET_VERSION_MINOR    0
  85.  
  86.  
  87. #ifndef _POSIX_PATH_MAX
  88. #define _POSIX_PATH_MAX         255
  89. #endif
  90.  
  91. #ifndef MAX_PATH
  92. #define    MAX_PATH    _POSIX_PATH_MAX
  93. #endif
  94.  
  95. #define MAX_ERRORS ESTALE
  96.  
  97. /* Windows File System Operations */
  98.  
  99. #define    FS_MIN                FS_OPENFILE
  100.  
  101. #define FS_OPENFILE            0x5A32
  102. #define    FS_CLOSEFILE        0x5A33
  103. #define    FS_READFILE            0x5A34
  104. #define    FS_WRITEFILE        0x5A35
  105. #define    FS_FILESEEK            0x5A36
  106. #define    FS_FINDFIRSTFILE    0x5A37
  107. #define    FS_FINDNEXTFILE        0x5A38
  108. #define    FS_FINDCLOSE        0x5A39
  109. #define    FS_DELETEFILE        0x5A3A
  110. #define    FS_DIR                0x5A3B
  111. #define    FS_RENAMEFILE        0x5A3C
  112. #define    FS_FILEATTRIBUTES    0x5A3D
  113. #define    FS_GETDISKINFO        0x5A3E
  114. #define    FS_LOCKFILE            0x5A3F
  115.  
  116. #define    FS_CONNNECTED        0x5A4F
  117. #define    FS_CONFIGURE        0x5A50
  118.  
  119. #define    FS_MAX                FS_CONFIGURE
  120.  
  121. #define    ZANSERV_IN_BUFFER_SIZE        16384 + 1024 
  122. #define    ZANSERV_OUT_BUFFER_SIZE        16384 + 1024
  123.  
  124. #define ERROR_OPEN_FAILED                110L
  125.  
  126.  
  127. typedef struct {
  128.     USHORT    usType;
  129.     USHORT    usLen;
  130.     ULONG    ulKey;
  131.     ULONG    ulFlags;
  132. } winio_generic;
  133.  
  134. /*
  135. * The following are Windows request and ack structures 
  136. */
  137.  
  138. typedef struct {
  139.     USHORT    usType;
  140.     USHORT    usLen;
  141.     ULONG    ulKey;
  142.     ULONG    ulFlags;
  143.     int        iFileHandle;
  144. } fs_close;
  145.  
  146. typedef struct {
  147.     USHORT    usType;
  148.     USHORT    usLen;
  149.     ULONG    ulKey;
  150.     ULONG    ulFlags;
  151.     short   rc;
  152.     short    pad;
  153. } fs_closeAck;
  154.  
  155. typedef struct {
  156.     USHORT    usType;
  157.     USHORT    usLen;
  158.     ULONG    ulKey;
  159.     ULONG    ulAttribs;    /* has wildcards */
  160.     short    sPathLen;
  161.     short    pad;
  162.     char    Path[4];    /* more data after this */
  163. } fs_deletefile;
  164.  
  165. typedef struct {
  166.     USHORT    usType;
  167.     USHORT    usLen;
  168.     ULONG    ulKey;
  169.     ULONG    ulFlags;
  170.     short    rc;
  171.     short    pad;
  172. } fs_deletefileAck;
  173.  
  174. typedef struct {
  175.     USHORT    usType;
  176.     USHORT    usLen;
  177.     ULONG    ulKey;
  178.     ULONG    ulFlags;
  179.     ULONG    ulAttribs;
  180.     short    sPathLen;
  181.     char    Path[2];    /* more data after this */
  182. } fs_dir;
  183.  
  184. typedef struct {
  185.     USHORT    usType;
  186.     USHORT    usLen;
  187.     ULONG    ulKey;
  188.     ULONG    ulFlags;
  189.     short    rc;
  190.     short    pad;
  191. } fs_dirAck;
  192.  
  193. typedef struct {
  194.     USHORT    usType;
  195.     USHORT    usLen;
  196.     ULONG    ulKey;
  197.     ULONG    ulFlags;
  198.     ULONG    ulAttribs;
  199.     time_t    NativeTime;
  200.     short    sPathLen;
  201.     short    pad;
  202.     char    Path[4];    /* more data after this */
  203. } fs_fileattributes;
  204.  
  205. typedef struct {
  206.     USHORT    usType;
  207.     USHORT    usLen;
  208.     ULONG    ulKey;
  209.     ULONG    ulFlags;
  210.     ULONG    ulAttribs;
  211.     time_t    NativeTime;
  212.     ULONG    ulFileSize;
  213.     short    rc;
  214.     short    pad;
  215. } fs_fileattributesAck;
  216.  
  217. typedef struct {
  218.     USHORT    usType;
  219.     USHORT    usLen;
  220.     ULONG    ulKey;
  221.     ULONG    ulFlags;
  222.     int        iFileHandle;
  223.     long    lSeekOffset;
  224. } fs_fileseek;
  225.  
  226. typedef struct {
  227.     USHORT    usType;
  228.     USHORT    usLen;
  229.     ULONG    ulKey;
  230.     ULONG    ulFlags;
  231.     long    lSeekOffset;
  232.     short    rc;
  233.     short    pad;
  234. } fs_fileseekAck;
  235.  
  236. typedef struct {
  237.     USHORT    usType;
  238.     USHORT    usLen;
  239.     ULONG    ulKey;
  240.     ULONG    ulFlags;
  241.     int        iFindHandle;
  242. } fs_findclose;
  243.  
  244. typedef struct {
  245.     USHORT    usType;
  246.     USHORT    usLen;
  247.     ULONG    ulKey;
  248.     ULONG    ulFlags;
  249.     short    rc;
  250.     short    pad;
  251. } fs_findcloseAck;
  252.  
  253. typedef struct {
  254.     USHORT    usType;
  255.     USHORT    usLen;
  256.     ULONG    ulKey;
  257.     ULONG    ulAttrib;    /* has wildcards */
  258.     ULONG    ulRetBufLen;
  259.     short    sPathLen;
  260.     short    pad;
  261.     char    Path[2];    /* more data after this */
  262. } fs_findfirstfile;
  263.  
  264. typedef struct {
  265.     ULONG    ulAttrib;
  266.     time_t    tCreate;
  267.     time_t    tLastAccess;
  268.     time_t    tLastWrite;
  269.     ULONG    ulFileSize;
  270.     short    sFileNameLen;
  271.     short    pad;
  272.     char    FileName[4];
  273. } fs_findfileinfo;
  274.  
  275. typedef struct {
  276.     USHORT    usType;
  277.     USHORT    usLen;
  278.     ULONG    ulKey;
  279.     int        iFindContext;
  280.     short    rc;
  281.     USHORT    sNumberOfFiles;
  282.     ULONG    ulRetBufLen;
  283.     fs_findfileinfo    FindFiles;
  284. } fs_findfirstfileAck;
  285.  
  286. typedef struct {
  287.     USHORT    usType;
  288.     USHORT    usLen;
  289.     ULONG    ulKey;
  290.     ULONG    ulFlags;    /* has wildcards */
  291.     int        iFindHandle;
  292.     ULONG    ulRetBufLen;
  293.     short    sPathLen;
  294.     short    pad;
  295.     char    Path[4];    /* more data after this */
  296. } fs_findnextfile;
  297.  
  298. typedef struct {
  299.     USHORT    usType;
  300.     USHORT    usLen;
  301.     ULONG    ulKey;
  302.     ULONG    ulFlags;
  303.     short    rc;
  304.     USHORT    sNumberOfFiles;
  305.     ULONG    ulRetBufLen;
  306.     fs_findfileinfo    FindFiles;
  307. } fs_findnextfileAck;
  308.  
  309. typedef struct {
  310.     USHORT    usType;
  311.     USHORT    usLen;
  312.     ULONG    ulKey;
  313.     ULONG    ulFlags;
  314. } fs_getdiskinfo;
  315.  
  316. typedef struct {
  317.     USHORT    usType;
  318.     USHORT    usLen;
  319.     ULONG    ulKey;
  320.     ULONG    ulFlags;
  321.     ULONG    ulDiskSpaceUsedBytes;
  322.     short    rc;
  323.     short    pad;
  324. } fs_getdiskinfoAck;
  325.  
  326. typedef struct {
  327.     USHORT    usType;
  328.     USHORT    usLen;
  329.     ULONG    ulKey;
  330.     ULONG    ulFlags;
  331.     int        iFileHandle;
  332.     ULONG    ulLockLength;
  333.     ULONG    ulLockOffset;
  334. } fs_lockfile;
  335.  
  336. typedef struct {
  337.     USHORT    usType;
  338.     USHORT    usLen;
  339.     ULONG    ulKey;
  340.     ULONG    ulFlags;
  341.     short    rc;
  342.     short    pad;
  343. } fs_lockfileAck;
  344.  
  345. typedef struct {
  346.     USHORT    usType;
  347.     USHORT    usLen;
  348.     ULONG    ulKey;
  349.     ULONG    ulFlags;
  350.     ULONG    ulAttribs;
  351.     USHORT    usOptions;
  352.     short    sPathLen;
  353.     char    Path[4];    /* more data after this */
  354. } fs_openfile;
  355.  
  356. typedef struct {
  357.     USHORT    usType;
  358.     USHORT    usLen;
  359.     ULONG    ulKey;
  360.     ULONG    ulFlags;
  361.     ULONG    ulAttribs;
  362.     int        iFileHandle;
  363.     time_t    LastAccess;
  364.     ULONG    ulSize;
  365.     short    rc;
  366.     USHORT    usAction;
  367. } fs_openfileAck;
  368.  
  369. typedef struct {
  370.     USHORT    usType;
  371.     USHORT    usLen;
  372.     ULONG    ulKey;
  373.     ULONG    ulFlags;
  374.     int        iFileHandle;
  375.     int        iLength;
  376.     long    lPosition;
  377. } fs_readfile;
  378.  
  379. typedef struct {
  380.     USHORT    usType;
  381.     USHORT    usLen;
  382.     ULONG    ulKey;
  383.     ULONG    ulFlags;
  384.     int        iLength;
  385.     long    lPosition;
  386.     short    rc;
  387.     short    pad;
  388.     char    Data[4];
  389. } fs_readfileAck;
  390.  
  391. typedef struct {
  392.     USHORT    usType;
  393.     USHORT    usLen;
  394.     ULONG    ulKey;
  395.     ULONG    ulAttribs;    /* has wildcards */
  396.     short    sPathLen1;
  397.     short    sPathLen2;
  398.     char    Paths[4];    /* more data after this */
  399. } fs_renamefile;
  400.  
  401. typedef struct {
  402.     USHORT    usType;
  403.     USHORT    usLen;
  404.     ULONG    ulKey;
  405.     ULONG    ulFlags;
  406.     short    rc;
  407.     short    pad;
  408. } fs_renamefileAck;
  409.  
  410. #define    ZANSERV_FSWRITE_MOVE_EOF    0x00000001
  411.  
  412. typedef struct {
  413.     USHORT    usType;
  414.     USHORT    usLen;
  415.     ULONG    ulKey;
  416.     ULONG    ulFlags;
  417.     int        iFileHandle;
  418.     int        iLength;
  419.     long    lPosition;
  420.     char    WriteData[4];
  421. } fs_writefile;
  422.  
  423. typedef struct {
  424.     USHORT    usType;
  425.     USHORT    usLen;
  426.     ULONG    ulKey;
  427.     ULONG    ulFlags;
  428.     int        iBytesWritten;
  429.     long    lPosition;
  430.     short    rc;
  431.     short    pad;
  432. } fs_writefileAck;
  433.  
  434. #define    ZANSERV_DEBUG_ON        0x00000001
  435. #define    ZANSERV_SHUTDOWN        0x00000002
  436. #define    ZANSERV_DEBUG_OFF        0x00000004
  437. #define    ZANSERV_NEW_HOME        0x00000008
  438. #define    ZANSERV_MAX_READDIRS    0x00000010
  439. #define    ZANSERV_ATTRIBS            0x00000020
  440. #define    ZANSERV_PING            0x00000040
  441.  
  442. typedef struct {
  443.     USHORT    usType;
  444.     USHORT    usLen;
  445.     ULONG    ulKey;
  446.     ULONG    ulFlags;
  447.     ULONG    ulServerDefaultAttribs;
  448.     ULONG    ulMaxReaddirs;
  449.     short    sPathLen;
  450.     short    pad;
  451.     char    HomePath[4];    /* more data after this */
  452.  
  453. } fs_configure;
  454.  
  455. typedef struct {
  456.     USHORT    usType;
  457.     USHORT    usLen;
  458.     ULONG    ulKey;
  459.     USHORT    usVersionMajor;
  460.     USHORT    usVersionMinor;
  461.     ULONG    rc;
  462.  
  463. } fs_configureAck;
  464.  
  465.  
  466.  
  467. /*********************** Windows IFS stuff **************************/
  468.  
  469. /* This section contains a condensed version of the 
  470. Windows DDK file ifs.h and winerror.h */
  471.  
  472. #define NO_ERROR                         0L
  473. #define ERROR_INVALID_FUNCTION           1L
  474. #define ERROR_FILE_NOT_FOUND             2L
  475. #define ERROR_INVALID_HANDLE             6L
  476. #define ERROR_DEV_NOT_EXIST              55L
  477. #define ERROR_UNEXP_NET_ERR              59L
  478. #define ERROR_DISK_FULL                  112L
  479. #define ERROR_ACCESS_DENIED              5L
  480. #define ERROR_INVALID_ADDRESS            487L
  481. #define ERROR_NETWORK_BUSY               54L
  482. #define ERROR_FILE_EXISTS                80L
  483. #define ERROR_DIRECTORY                  267L
  484. #define ERROR_DIR_NOT_EMPTY              145L
  485. #define ERROR_BAD_ARGUMENTS              160L
  486. #define ERROR_TOO_MANY_OPEN_FILES        4L
  487. #define ERROR_SEEK_ON_DEVICE             132L
  488. #define ERROR_BROKEN_PIPE                109L
  489. #define ERROR_POSSIBLE_DEADLOCK          1131L
  490. #define ERROR_NOT_READY                  21L
  491. #define ERROR_WRITE_PROTECT              19L
  492. #define ERROR_NOT_DOS_DISK               26L
  493. #define ERROR_LOCK_VIOLATION             33L
  494. #define ERROR_PATH_NOT_FOUND             3L
  495. #define ERROR_GEN_FAILURE                31L
  496. #define ERROR_READ_FAULT                 30L
  497. #define ERROR_WRITE_FAULT                29L
  498. #define ERROR_NO_MORE_FILES              18L
  499. #define ERROR_BAD_PATHNAME               161L
  500. #define ERROR_ALREADY_EXISTS             183L
  501.  
  502.              
  503.  
  504. /** FS_CLOSEFILE **/
  505.  
  506. #define CLOSE_HANDLE        0        /* only closing a handle */
  507. #define CLOSE_FOR_PROCESS    1        /* last close of SFN for this process */
  508. #define CLOSE_FINAL            2        /* final close of SFN for system */
  509.  
  510. #define FILE_NO_LAST_ACCESS_DATE    0x01    /* do not update last access date */
  511. #define FILE_CLOSE_FOR_LEVEL4_LOCK    0x02    /* special close on a level 4 lock */
  512. #define FILE_COMMIT_ASYNC            0x04    /* commit async instead of sync */
  513.  
  514. /** FS_DIR **/
  515.  
  516. #define CREATE_DIR        0
  517. #define DELETE_DIR        1
  518. #define CHECK_DIR        2
  519. #define QUERY83_DIR        3
  520. #define QUERYLONG_DIR    4
  521.  
  522. /** FS_LOCKFILE **/
  523.  
  524. #define LOCK_REGION        0            /* lock specified file region */
  525. #define UNLOCK_REGION    1            /* unlock region */
  526.  
  527. #define LOCKF_MASK_RDWR    0x01    /* Read / write lock flag */
  528. #define LOCKF_WR        0x00    /* bit 0 clear - write lock */
  529. #define LOCKF_RD        0x01    /* bit 0 set - read lock(NW only) */
  530.  
  531. #define LOCKF_MASK_DOS_NW    0x02    /* DOS/Netware style lock flag */
  532. #define LOCKF_DOS            0x00    /* bit 1 clear - DOS-style lock */
  533. #define LOCKF_NW            0x02    /* bit 1 set - Netware-style lock */
  534.  
  535. /** FS_ENUMERATEHANDLE **/
  536.  
  537. #define ENUMH_GETFILEINFO    0        /* get fileinfo by handle */
  538. #define ENUMH_GETFILENAME    1        /* get filename associated with handle */
  539. #define ENUMH_GETFINDINFO    2        /* get info for resuming */
  540. #define ENUMH_RESUMEFIND    3        /* resume find operation */
  541. #define ENUMH_RESYNCFILEDIR    4        /* resync dir entry info for file */
  542.  
  543. #define RESYNC_INVALIDATEMETACACHE    0x01    /* invalidate meta cache on resync */
  544.  
  545.  
  546. /** FS_FILEATTRIBUTES **/
  547.  
  548. #define GET_ATTRIBUTES                    0    /* get attributes of file/dir         */
  549. #define SET_ATTRIBUTES                    1    /* set attributes of file/dir         */
  550. #define GET_ATTRIB_COMP_FILESIZE        2    /* get compressed size of file        */
  551.  
  552.  
  553. /** FS_FILEDATATIME **/
  554.  
  555. #define SET_ATTRIB_MODIFY_DATETIME        3    /* set date last written of file/dir  */ 
  556. #define GET_ATTRIB_MODIFY_DATETIME        4     /* get date last written of file/dir  */ 
  557. #define SET_ATTRIB_LAST_ACCESS_DATETIME    5     /* set date last accessed of file/dir */   
  558. #define GET_ATTRIB_LAST_ACCESS_DATETIME    6    /* get date last accessed of file/dir */  
  559. #define SET_ATTRIB_CREATION_DATETIME    7    /* set create date of file/dir        */
  560. #define GET_ATTRIB_CREATION_DATETIME    8    /* get create date of file/dir        */
  561.  
  562. /** FS_GETDISKINFO **/
  563.  
  564. #define GDF_NORMAL            0x00    /* walk disk, if needed, to get free space */
  565. #define GDF_NO_DISK_HIT        0x01    /* return current "hint", don't walk disk */
  566.  
  567. #define GET_MODIFY_DATETIME            0    /* get last modification date/time */
  568. #define SET_MODIFY_DATETIME            1    /* set last modification date/time */
  569. #define GET_LAST_ACCESS_DATETIME    4    /* get last access date/time */
  570. #define SET_LAST_ACCESS_DATETIME    5    /* set last access date/time */
  571. #define GET_CREATION_DATETIME        6    /* get creation date/time */
  572. #define SET_CREATION_DATETIME        7    /* set creation date/time */
  573.  
  574. /** FS_FILESEEK **/
  575.  
  576. #define FILE_BEGIN    0                /* absolute posn from file beginning */
  577. #define FILE_END    2                /* signed posn from file end */
  578.  
  579. /** FS_READFILE, FS_WRITEFILE **/
  580.  
  581. #define R0_NO_CACHE                0x0100    /* must not cache reads/writes */
  582. #define R0_SWAPPER_CALL            0x1000    /* called by the swapper */
  583. #define R0_MM_READ_WRITE        0x8000    /* indicates this is a MMF R0 i/o */
  584. #define R0_SPLOPT_MASK            0xFF00    /* mask for ring 0 special options */
  585.  
  586. /** FS_OPENFILE **/
  587.  
  588. #define ACCESS_MODE_MASK    0x0007    /* Mask for access mode bits */
  589. #define ACCESS_READONLY        0x0000    /* open for read-only access */
  590. #define ACCESS_WRITEONLY    0x0001    /* open for write-only access */
  591. #define ACCESS_READWRITE    0x0002    /* open for read and write access */
  592. #define ACCESS_EXECUTE        0x0003    /* open for execute access */
  593.  
  594. #define SHARE_MODE_MASK        0x0070    /* Mask for share mode bits */
  595. #define SHARE_COMPATIBILITY 0x0000    /* open in compatability mode */
  596. #define SHARE_DENYREADWRITE 0x0010    /* open for exclusive access */
  597. #define SHARE_DENYWRITE        0x0020    /* open allowing read-only access */
  598. #define SHARE_DENYREAD        0x0030    /* open allowing write-only access */
  599. #define SHARE_DENYNONE        0x0040    /* open allowing other processes access */
  600. #define SHARE_FCB            0x0070    /* FCB mode open */
  601.  
  602. #define ACTION_MASK                0xff    /* Open Actions Mask */
  603. #define ACTION_OPENEXISTING        0x01    /* open an existing file */
  604. #define ACTION_REPLACEEXISTING    0x02    /* open existing file and set length */
  605. #define ACTION_CREATENEW        0x10    /* create a new file, fail if exists */
  606. #define ACTION_OPENALWAYS        0x11    /* open file, create if does not exist */
  607. #define ACTION_CREATEALWAYS        0x12    /* create a new file, even if it exists */
  608.  
  609. #define ACTION_EXISTS_OPEN        0x01    // BIT: If file exists, open file
  610. #define ACTION_TRUNCATE            0x02    // BIT: Truncate file
  611. #define ACTION_NEXISTS_CREATE    0x10    // BIT: If file does not exist, create
  612.  
  613. #define OPEN_FLAGS_NOINHERIT    0x0080
  614. #define OPEN_FLAGS_NO_CACHE        R0_NO_CACHE /* 0x0100 */
  615. #define OPEN_FLAGS_NO_COMPRESS    0x0200
  616. #define OPEN_FLAGS_ALIAS_HINT    0x0400
  617. #define OPEN_FLAGS_NOCRITERR    0x2000
  618. #define OPEN_FLAGS_COMMIT        0x4000
  619. #define OPEN_FLAGS_REOPEN        0x0800    /* file is being reopened on vol lock */
  620.  
  621. #define ACTION_OPENED        1        /* existing file has been opened */
  622. #define ACTION_CREATED        2        /* new file has been created */
  623. #define ACTION_REPLACED        3        /* existing file has been replaced */
  624.  
  625. /** FS_SEARCHFILE **/
  626.  
  627. #define SEARCH_FIRST        0        /* findfirst operation */
  628. #define SEARCH_NEXT            1        /* findnext operation */
  629.  
  630. /** FS_DELETFILE, FS_FILEATTRIBUTES, FS_FINDFIRSTFILE, FS_FINDNEXTFILE,
  631.     FS_RENAMEFILE  **/ 
  632.  
  633. #ifndef FILE_ATTRIBUTE_READONLY
  634. #define FILE_ATTRIBUTE_READONLY        0x01    /* read-only file */
  635. #endif
  636.  
  637. #ifndef FILE_ATTRIBUTE_HIDDEN
  638. #define FILE_ATTRIBUTE_HIDDEN        0x02    /* hidden file */
  639. #endif
  640.  
  641. #ifndef FILE_ATTRIBUTE_SYSTEM
  642. #define FILE_ATTRIBUTE_SYSTEM        0x04    /* system file */
  643. #endif
  644.  
  645. #ifndef FILE_ATTRIBUTE_LABEL
  646. #define FILE_ATTRIBUTE_LABEL        0x08    /* volume label */
  647. #endif
  648.  
  649. #ifndef FILE_ATTRIBUTE_DIRECTORY
  650. #define FILE_ATTRIBUTE_DIRECTORY    0x10    /* subdirectory */
  651. #endif
  652.  
  653. #ifndef FILE_ATTRIBUTE_ARCHIVE
  654. #define FILE_ATTRIBUTE_ARCHIVE        0x20    /* archived file/directory */
  655. #endif
  656.  
  657.  
  658. #define FILE_ATTRIBUTE_DEVICE        0x40    /* device */
  659.  
  660. #define FILE_ATTRIBUTE_MUSTMATCH    0x00003F00    /* 00ADVSHR Must Match */
  661. #define FILE_ATTRIBUTE_EVERYTHING    0x0000003F    /* 00ADVSHR Find Everything */
  662. #define FILE_ATTRIBUTE_INTERESTING    0x0000001E    /* 000DVSH0 Search bits */
  663.  
  664. #define    FIND_FLAG_PRI_NAME_LOSS            0x0001
  665. #define    FIND_FLAG_ALT_NAME_LOSS            0x0002
  666.  
  667. #define FILE_FLAG_WILDCARDS    0x80000000    /* set if wildcards in name */
  668. #define FILE_FLAG_HAS_STAR    0x40000000    /* set if *'s in name (PARSE_WILD also set) */
  669. #define FILE_FLAG_LONG_PATH    0x20000000    /* set if any path element is not 8.3 */
  670. #define FILE_FLAG_KEEP_CASE    0x10000000    /* set if FSD should use ir_uFName */
  671. #define FILE_FLAG_HAS_DOT    0x08000000    /* set if last path element contains .'s */
  672. #define FILE_FLAG_IS_LFN    0x04000000    /* set if last element is LFN */
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.